package com.example.demo.control;

import com.alibaba.fastjson.JSON;
import com.example.demo.pojo.CStropShow;
import com.example.demo.service.CStorOrderService;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@ResponseBody
@Controller
public class COrderShowControl {
    @Resource
    CStorOrderService cStorOrderService;
    @PostMapping("/c/corderShowControl/show")
    public String COrderShowControl(String state,String name,String begin,String end,String thispage){
       PageInfo<CStropShow> a= cStorOrderService.Cstropshowinfo(Integer.parseInt(thispage),5,name,state,begin,end);
        return JSON.toJSONString(a);
    }
    @PostMapping("/c/cordelShowControl/delete")
    public String COrderdelControl(String seq){
        String a= cStorOrderService.CorderdelService(seq);
        return JSON.toJSONString(a);
    }

    @PostMapping("/c/ccjordelShowControl/update")
    public String COupdateccjControl2(String seq,String num,String location,String begin,String end,String workerid,String money){
        System.out.println("进入");
        String a= cStorOrderService.CorderUpdate(num,workerid,money,location,begin,end,seq);
        return JSON.toJSONString(a);
    }
}
